#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableSailorSkillReleaseHitStopDao:DaoBase<TableSailorSkillReleaseHitStop>
    {
        public override string GetFileName()
        {
            return "TableSailorSkillReleaseHitStop.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableSailorSkillReleaseHitStop>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddOneIndex(TableSailorSkillReleaseHitStop model)
        {
            if (!cacheOneIndex.ContainsKey(model.SkillId.ToString()))
            {
                cacheOneIndex[model.SkillId.ToString()] = new List<TableSailorSkillReleaseHitStop>();
            }
            cacheOneIndex[model.SkillId.ToString()].Add(model);
        }
        public override void AddPrimaryIndex(TableSailorSkillReleaseHitStop model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.HitStopId)) UnityEngine.Debug.LogError("数据表id重复:TableSailorSkillReleaseHitStop->id: " + model.HitStopId);
            #endif
            cachePrimaryInt[model.HitStopId] = model;
        }
        protected override TableSailorSkillReleaseHitStop ParseRowData(string[] rowData)
        {
            TableSailorSkillReleaseHitStop data = new TableSailorSkillReleaseHitStop();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.HitStopId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.SkillId = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.HitStopTime = double.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.HitStopDuration = double.Parse(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.HitStopCurve = string.Intern(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.ShakeType = int.Parse(rowData[5]);
            }
            return data;
        }
    }
}
